package com.neusoft.my12306.service.impl;

import com.neusoft.my12306.common.res.CommonResult;
import com.neusoft.my12306.entity.Passenger;
import com.neusoft.my12306.mapper.PassengerMapper;
import com.neusoft.my12306.service.IPassengerService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 段静迪
 * @since 2023-07-03
 */
@Service
public class PassengerServiceImpl extends ServiceImpl<PassengerMapper, Passenger> implements IPassengerService {

    @Override
    public CommonResult findAll() {
        List  list = baseMapper.selectList(null);
        CommonResult  result =new CommonResult(list);
        if (list ==null ||  list.size() ==0){
            result.setNotFound();
        }
        return result;
    }
}
